#ifndef MessageToast_H
#define MessageToast_H
#include "baseshadowdialog.h"
#include <QObject>
#include <QRect>

#include <QWidget>

namespace Ui {
class MessageToastWidget;
}

class MessageToastWidget : public QWidget
{
    Q_OBJECT

public:
    explicit MessageToastWidget(QWidget *parent = nullptr);
    ~MessageToastWidget();

    void setToastText(const QString& text);

private:
    Ui::MessageToastWidget *ui;
};
 
class MessageToast: QObject
{
public:
    enum Level
    {
      INFO, WARN, ERROR
    };
private:
    MessageToast();
    ~MessageToast();
public:
    static MessageToast& instance();
public:
    void show(Level level, const QString& text);
 
private:
    void timerEvent(QTimerEvent *event) override;
 
private:
    MessageToastWidget* mToastWidget;
    BaseShadowDialog* mDialog;

    int mTimerId{0};
};
 
#endif // MessageToast_H
